﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace GNSystem.Models
{
    [Table("Posts")]
    public class Post
    {
        [Key]
        public int ID { get; set; }
        public int ThreadID { get; set; }
        public int UserID { get; set; }

        [Required]
        [Timestamp]
        public DateTime CreationTime { get; set; }

        public DateTime LastEdit { get; set; }
        public int LastEditor { get; set; }

        [Required(AllowEmptyStrings = false)]
        [StringLength(int.MaxValue, MinimumLength=5)]
        public string Content { get; set; }
    }
    [Table("Threads")]
    public class Thread
    {
        [Key]
        public int ID { get; set; }
        public int ForumID { get; set; }
        public int UserID { get; set; }

        [Required(AllowEmptyStrings=false)]
        [StringLength(256, MinimumLength = 1)]
        public string Subject { get; set; }


        [Required]
        [Timestamp]
        public DateTime CreationTime { get; set; }

        [Required(AllowEmptyStrings = false)]
        [StringLength(int.MaxValue, MinimumLength = 3)]
        public string Content { get; set; }
    }
}